--[[
	GMod Last Man Standing, a gamemode for Garry's Mod
    Copyright (C) 2012 Wickex

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
]]

if SERVER then
	AddCSLuaFile("shared.lua")
	
	resource.AddFile("materials/models/weapons/shovel/shovel.vmt")
	resource.AddFile("materials/models/weapons/shovel/shovel.vtf")
	resource.AddFile("materials/vgui/entities/shovel.vtf")
	resource.AddFile("materials/vgui/entities/shovel.vmt")
	resource.AddFile("models/weapons/shovel/v_shovel.dx80.vtx")
	resource.AddFile("models/weapons/shovel/v_shovel.dx90.vtx")
	resource.AddFile("models/weapons/shovel/v_shovel.mdl")
	resource.AddFile("models/weapons/shovel/v_shovel.sw.vtx")
	resource.AddFile("models/weapons/shovel/v_shovel.vvd")
	resource.AddFile("models/weapons/shovel/w_shovel.dx80.vtx")
	resource.AddFile("models/weapons/shovel/w_shovel.dx90.vtx")
	resource.AddFile("models/weapons/shovel/w_shovel.mdl")
	resource.AddFile("models/weapons/shovel/w_shovel.sw.vtx")
	resource.AddFile("models/weapons/shovel/w_shovel.vvd")
	resource.AddFile("sound/weapons/shovel/shovel_hitbody.wav")
	resource.AddFile("sound/weapons/shovel/shovel_hit.wav")
	resource.AddFile("sound/weapons/shovel/shovel_miss.wav")
end

if CLIENT then
	SWEP.PrintName = "Shovel"
end

SWEP.Base = "weapon_glms_base_melee" --weapon_glms_base_melee for melee weapons, weapon_glms_base_ranged for ranged weapons

SWEP.Author = ""
SWEP.Contact = ""
SWEP.Purpose = ""
SWEP.Instructions = ""

SWEP.ViewModelFOV = 60
SWEP.ViewModelFlip = true

SWEP.HoldType = "melee"

SWEP.Spawnable = false
SWEP.AdminSpawnable = true
SWEP.RandomSpawn = true --Should the SWEP spawn in one of the random spawning locations? (Disable for special/admin weapons etc)

SWEP.ViewModel = "models/weapons/shovel/v_shovel.mdl"
SWEP.WorldModel	= "models/weapons/shovel/w_shovel.mdl"

SWEP.Primary.Damage = 20
SWEP.Primary.Delay = 1
SWEP.Primary.Automatic = false
SWEP.Primary.Knockback = 150 --How much the person hit gets knocked back
SWEP.Primary.Range = 75 --How far the range of the weapon is (melee only)

SWEP.DelayT1 = 0.1 --Delay until animation starts after having pressed +attack
SWEP.DelayT2 = 0.3 --Delay until the weapon deals damage (this should be synchronised with the time it takes for the animation to reach it's attacking point)

SWEP.Hit = { "weapons/shovel/shovel_hit.wav" }
SWEP.HitBody = { "weapons/shovel/shovel_hitbody.wav" }
SWEP.Miss = { "weapons/shovel/shovel_miss.wav" }

SWEP.Animations = {
   ACT_VM_PRIMARYATTACK_1,
   ACT_VM_PRIMARYATTACK_2,
   ACT_VM_PRIMARYATTACK_4,
   ACT_VM_PRIMARYATTACK_5,
}
SWEP.Animations.Count = #SWEP.Animations